home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume8 / libhoward / part03 < prev    next >
Encoding:
Text File  |  1989-09-30  |  46.3 KB  |  1,865 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v08i081: libhoward portability library, part 3 of 9
  3. from: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  4. Reply-To: howard@dahlbeck.ericsson.se (Howard Gayle)
  5.  
  6. Posting-number: Volume 8, Issue 81
  7. Submitted-by: howard@dahlbeck.ericsson.se (Howard Gayle)
  8. Archive-name: libhoward/part03
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then feed it
  12. # into a shell via "sh file" or similar.  To overwrite existing files,
  13. # type "sh file -c".
  14. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  15. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  16. # If this archive is complete, you will see the following message at the end:
  17. #        "End of archive 3 (of 9)."
  18. # Contents:  FREEZE Makefile a2l.c getlic.c malf.3 mk-smp.c new-Make.b
  19. #   strspn.c
  20. # Wrapped by howard@hasse on Mon Sep 25 07:08:06 1989
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'FREEZE' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'FREEZE'\"
  24. else
  25. echo shar: Extracting \"'FREEZE'\" \(5524 characters\)
  26. sed "s/^X//" >'FREEZE' <<'END_OF_FILE'
  27. X$Header: FREEZE,v 1.7 89/09/25 07:03:19 howard Exp $
  28. X$Log:    FREEZE,v $
  29. X# Revision 1.7  89/09/25  07:03:19  howard
  30. X# *** empty log message ***
  31. X# 
  32. X# Revision 1.6  89/09/23  14:24:24  howard
  33. X# *** empty log message ***
  34. X# 
  35. X# Revision 1.5  89/09/19  09:09:46  howard
  36. X# *** empty log message ***
  37. X# 
  38. X# Revision 1.4  89/08/29  17:19:00  howard
  39. X# *** empty log message ***
  40. X# 
  41. X# Revision 1.3  89/08/11  14:52:36  howard
  42. X# *** empty log message ***
  43. X# 
  44. X========================================
  45. XFREEZE.c     1.1     1989-08-05 08:46:25
  46. XMakeCommon   1.3     1989-09-22 13:46:45
  47. XMakefile     1.24    1989-09-23 15:23:28
  48. XREADME       1.3     1989-09-23 15:25:11
  49. Xa2.3         1.2     1989-08-10 13:53:23
  50. Xa2.h         1.4     1989-06-22 15:11:58
  51. Xa2d.c        1.7     1989-08-09 18:13:20
  52. Xa2i.c        1.7     1989-08-10 13:02:15
  53. Xa2l.c        1.12    1989-08-11 13:07:15
  54. Xa2smp.c      1.11    1989-08-15 13:33:10
  55. Xa2u.c        1.6     1989-08-11 14:08:33
  56. Xa2ul.c       1.7     1989-08-11 14:17:25
  57. Xb.bib        1.1     1989-09-20 12:35:29
  58. Xcat-path.1   1.1     1989-09-21 10:52:02
  59. Xcat-path.b   1.1     1989-09-21 08:01:10
  60. Xcia.1        1.1     1989-09-23 14:11:22
  61. Xcia.b        1.3     1989-09-23 14:06:03
  62. Xcopy-self.1  1.2     1989-09-20 13:58:12
  63. Xcopy-self.b  1.5     1989-09-21 07:18:17
  64. Xfreeze.1     1.1     1989-09-23 14:22:28
  65. Xfreeze.b     1.8     1989-09-21 19:21:19
  66. Xfreeze0.b    1.6     1989-09-21 19:21:28
  67. XfreezePch.1  1.2     1989-09-25 07:01:32
  68. XfreezePch.b  1.2     1989-09-25 07:01:13
  69. XfreezePch0.b 1.1     1989-09-23 10:39:47
  70. Xgetlic.c     1.5     1989-08-09 09:46:01
  71. Xgetlin.3     1.7     1989-07-05 07:31:35
  72. Xgetlin.c     1.7     1989-08-09 09:46:03
  73. Xgetopt.c     1.1     1989-08-29 17:16:53
  74. Xgetpwf.3     1.2     1989-08-21 08:43:59
  75. Xgetpwf.c     1.2     1989-08-20 11:05:20
  76. Xgold-lt.tex  1.2     1989-08-28 19:02:50
  77. Xhetero.tex   1.2     1989-09-20 13:03:18
  78. Xlatin-lt.tex 1.3     1989-09-19 12:04:12
  79. XlnR.1        1.2     1989-09-15 11:45:47
  80. XlnR.b        1.3     1989-09-21 19:22:13
  81. XlnR0.b       1.4     1989-09-21 19:22:16
  82. Xma2d.c       1.6     1989-08-12 08:58:22
  83. Xma2i.c       1.6     1989-08-12 09:10:44
  84. Xma2l.c       1.3     1989-08-12 09:22:39
  85. Xma2u.c       1.4     1989-08-12 09:37:32
  86. Xma2ul.c      1.3     1989-08-12 09:56:17
  87. Xmalf.3       1.11    1989-08-14 09:06:30
  88. Xmalf.c       1.10    1989-08-21 17:50:36
  89. Xmalf.h       1.18    1989-08-20 10:45:05
  90. Xmalf0.c      1.11    1989-08-21 17:50:47
  91. Xmalf1.c      1.8     1989-08-21 17:50:50
  92. Xmcalloc.c    1.5     1989-08-13 10:19:24
  93. Xmcpstr.3     1.2     1989-05-18 10:56:17
  94. Xmcpstr.c     1.4     1989-08-13 15:27:43
  95. Xmemcmp.c     1.1     1989-08-15 18:17:12
  96. Xmfclose.c    1.3     1989-08-13 14:53:25
  97. Xmfcopy.3     1.1     1989-08-13 15:45:31
  98. Xmfcopy.c     1.4     1989-08-13 15:37:56
  99. Xmfflush.c    1.4     1989-08-13 14:59:43
  100. Xmfopen.c     1.5     1989-08-13 15:07:38
  101. Xmfseek.c     1.4     1989-08-13 15:18:44
  102. Xmk-cc-lims.b 1.6     1989-09-21 19:22:19
  103. Xmk-reg.b     1.4     1989-09-20 12:21:49
  104. Xmk-smp.c     1.5     1989-08-15 14:25:55
  105. XmkAr.b       1.1     1989-09-22 13:37:21
  106. XmkCIncl.b    1.3     1989-09-21 19:22:21
  107. XmkDistI.b    1.4     1989-09-21 19:22:24
  108. XmkDistO.b    1.3     1989-09-21 19:22:26
  109. XmkFreeze.b   1.3     1989-09-20 13:40:05
  110. XmkInstF.b    1.3     1989-09-21 19:22:29
  111. XmkInstX.b    1.3     1989-09-21 19:22:32
  112. XmkLaTeXPS.b  1.3     1989-09-20 12:22:10
  113. XmkLibIncl.b  1.3     1989-09-21 19:22:34
  114. XmkLibcLims.b 1.8     1989-09-21 19:22:37
  115. XmkManPS.b    1.3     1989-09-21 19:22:39
  116. XmkSpellLT.b  1.2     1989-09-20 12:22:20
  117. XmkUncmprs.b  1.3     1989-09-21 19:22:42
  118. Xmopenp.3     1.1     1989-08-13 16:20:15
  119. Xmopenp.c     1.6     1989-09-21 07:43:04
  120. Xmra2d.c      1.5     1989-08-12 10:43:12
  121. Xmra2i.c      1.5     1989-08-13 07:35:40
  122. Xmra2l.c      1.2     1989-08-13 08:05:51
  123. Xmra2u.c      1.4     1989-08-13 07:46:02
  124. Xmra2ul.c     1.2     1989-08-13 08:20:50
  125. Xmsgfn.3      1.2     1989-08-21 08:37:19
  126. Xmsgfn.c      1.2     1989-08-19 10:19:10
  127. Xnew-1.b      1.2     1989-09-21 12:39:49
  128. Xnew-3.b      1.1     1989-09-21 12:44:29
  129. Xnew-Make.b   1.2     1989-09-23 15:24:04
  130. Xnew-MakeC.b  1.1     1989-09-21 12:48:58
  131. Xnew-b.b      1.2     1989-09-23 13:49:12
  132. Xnew-bib.b    1.1     1989-09-21 11:03:58
  133. Xnew-c.b      1.1     1989-09-21 18:32:17
  134. Xnew-el.b     1.1     1989-09-21 18:19:01
  135. Xnew-h.b      1.1     1989-09-21 18:25:40
  136. Xnew-uMake.b  1.1     1989-09-21 18:14:52
  137. Xnew.1        1.2     1989-09-22 07:24:33
  138. Xnew.b        1.1     1989-09-21 08:00:39
  139. Xport.h       1.30    1989-08-29 08:52:40
  140. Xprefix.3     1.4     1989-08-19 10:38:38
  141. Xprefix.c     1.5     1989-08-13 16:55:44
  142. Xprefxi.c     1.1     1989-08-19 10:31:17
  143. Xputspn.3     1.9     1989-08-14 09:07:40
  144. Xputspn.c     1.10    1989-08-13 16:31:09
  145. Xqrndu.3      1.1     1989-08-14 10:46:02
  146. Xqrndu.c      1.7     1989-08-14 10:41:31
  147. Xsmp.3        1.3     1989-08-15 14:53:10
  148. Xsmp.h        1.2     1989-08-15 14:31:10
  149. Xsmp2l.c      1.9     1989-08-14 18:20:04
  150. Xsmp2u.c      1.2     1989-08-14 18:29:32
  151. Xsmp2ul.c     1.7     1989-08-15 11:14:04
  152. Xsmpdig.c     1.6     1989-08-14 17:52:43
  153. Xsmpdtl.c     1.6     1989-08-14 17:37:31
  154. Xstrend.3     1.6     1989-08-14 09:31:24
  155. Xstrend.c     1.6     1989-08-14 09:27:31
  156. Xstrspn.c     1.1     1989-08-29 08:34:07
  157. XuMakefile    1.12    1989-09-22 13:46:53
  158. Xunix-lt.tex  1.1     1989-08-28 19:15:46
  159. Xusage.3      1.5     1989-08-14 09:23:24
  160. Xusage.c      1.6     1989-08-14 09:18:44
  161. Xusage.h      1.1     1988-08-21 09:02:44
  162. Xuserfn.3     1.1     1989-08-20 11:39:55
  163. Xuserfn.c     1.2     1989-08-20 11:30:07
  164. Xversion.h    1.3     1989-03-17 15:33:37
  165. Xyear.h       1.2     1989-08-14 09:54:12
  166. Xyrwk.3       1.2     1989-08-14 10:09:58
  167. Xyrwk.c       1.5     1989-08-14 10:01:11
  168. END_OF_FILE
  169. if test 5524 -ne `wc -c <'FREEZE'`; then
  170.     echo shar: \"'FREEZE'\" unpacked with wrong size!
  171. fi
  172. # end of 'FREEZE'
  173. fi
  174. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  175.   echo shar: Will not clobber existing file \"'Makefile'\"
  176. else
  177. echo shar: Extracting \"'Makefile'\" \(6702 characters\)
  178. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  179. X# Makefile - main GNU make file for -lhoward and include/howard
  180. X#
  181. X# $Header: Makefile,v 1.24 89/09/23 15:23:28 howard Exp $
  182. X#
  183. X# Copyright 1989 Howard Lee Gayle
  184. X# This file is written in the ISO 8859/1 character set.
  185. X#
  186. X# This program is free software; you can redistribute it and/or modify
  187. X# it under the terms of the GNU General Public License version 1,
  188. X# as published by the Free Software Foundation.
  189. X#
  190. X# This program is distributed in the hope that it will be useful,
  191. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  192. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  193. X# GNU General Public License for more details.
  194. X#
  195. X# You should have received a copy of the GNU General Public License
  196. X# along with this program; if not, write to the Free Software
  197. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  198. X
  199. Xinclude MakeCommon
  200. X
  201. X# Commands:
  202. X
  203. X# Make library.
  204. XAR=mkAr
  205. X
  206. X# Put a file into the distribution directory.
  207. XDISTO=mkDistO
  208. X
  209. X# Install a non-executable file.
  210. XINSTF=mkInstF
  211. X
  212. X# Make a shared library.
  213. XLD=ld
  214. X
  215. X# Lint command.
  216. XLINT=lint
  217. X
  218. X# shar command
  219. XSHAR=makekit
  220. X
  221. X
  222. X# Command options:
  223. X
  224. X# CC: max optimization
  225. XCFLAGS=-O4
  226. X
  227. X# LINT: check everything
  228. XLINTFLAGS=-abchux
  229. X
  230. X# CC: for testing, use -g option and static linking.
  231. XTESTCFLAGS=-g -Bstatic
  232. X
  233. X# CC: for testing, compile with this library.
  234. XLIBES=-lhoward
  235. X
  236. X# CC: library search path for testing.
  237. XLIBPATH=-L/usr/local/free-dist/howard/1/work
  238. X
  239. X# Directories:
  240. X
  241. X# Install library here.
  242. XAID=/usr/local/free/howard/1
  243. X
  244. X# Install Bourne shell files here.
  245. XBID=../bin
  246. X
  247. X# Install include files here.
  248. XHID=../include/howard
  249. X
  250. X# Install lint library here.
  251. XLNID=/usr/local/free/howard/1
  252. X
  253. X# Install man entries here.
  254. XMID=../man
  255. X
  256. X# Install shared library here.
  257. XSLID=/usr/local/free/howard/1
  258. X
  259. X# Install TeX and LaTeX macro files here.
  260. XTEXID=../tex
  261. X
  262. X
  263. X# Sources:
  264. X
  265. X# Bourne shell files.
  266. XBS := $(filter %.b,$(SRCS))
  267. X
  268. X# BibTeX bibliography file.
  269. XBIBS := $(filter %.bib,$(SRCS))
  270. X
  271. X# BibTeX bibliography file.
  272. XBIBS := $(filter %.bib,$(SRCS))
  273. X
  274. X# C programs.
  275. XCS := $(shell $(SETS) $(filter %.c,$(SRCS)) -d $(SCS))
  276. X
  277. X# C include files.
  278. XHS := $(filter %.h,$(SRCS))
  279. X
  280. X# LaTeX source.
  281. XLATEXS := hetero.tex
  282. X
  283. X# Manuals.
  284. XM1S := $(filter %.1,$(SRCS))
  285. XM3S := $(filter %.3,$(SRCS))
  286. Xms  := $(M1S) $(M3S)
  287. X
  288. X# TeX and LaTeX macro files.
  289. XTEXS := $(shell $(SETS) $(filter %.tex,$(SRCS)) -d $(LATEXS))
  290. X
  291. X# All ordinary source files.  Removed by make clobber.
  292. Xsrc := $(SBS) $(BS) $(BIBS) $(SCS) $(CS) $(HS) $(LATEXS) $(ms) $(TEXS)
  293. X
  294. X# Absolutely all source files.
  295. Xallsrc := README LICENSE FREEZE MakeCommon Makefile uMakefile $(src)
  296. X
  297. X
  298. X# Targets:
  299. X
  300. X# Library.
  301. XAT = libhoward.a
  302. X
  303. X# Bourne shell files.
  304. Xbt := $(subst .b,,$(BS))
  305. X
  306. X# LaTeX.
  307. Xifdef FMTLATEX
  308. Xlatext := $(subst .tex,.texf,$(LATEXS))
  309. Xspellt := $(patsubst %.tex,%-s,$(LATEXS))#Phony targets for spelling checking.
  310. Xendif
  311. X
  312. X# Lint library.
  313. XLNT = llib-lhoward.ln
  314. X
  315. X# Phony lint targets for C functions.
  316. Xlt := $(patsubst %.c,%-l,$(SCS) $(CS))
  317. X
  318. X# C function object files.
  319. Xot := $(subst .c,.o,$(CS))
  320. X
  321. X# Assembler targets for C functions.
  322. Xst :=$(subst .c,.s,$(CS))
  323. X
  324. X# Test drivers for C functions.
  325. Xtt :=$(patsubst %.c,%-t,$(CS))
  326. X
  327. X# Formatted manual entries.
  328. Xifdef FMTMAN
  329. Xft := $(patsubst %,%.f,$(ms))
  330. Xendif
  331. X
  332. X# Default targets.
  333. Xtargets := $(LNT) $(ot) $(AT) $(SLT) $(ft) $(TEXS)
  334. X
  335. X# Distribution:
  336. Xdist := $(patsubst %,$(DD)/%,$(allsrc) $(ft))
  337. X
  338. X
  339. X# Installs:
  340. X
  341. X# Library.
  342. Xai := $(AID)/$(AT)
  343. X
  344. X# Bourne shell files.
  345. Xbi := $(patsubst %,$(BID)/%,$(bt))
  346. X
  347. X# On-line manual entries.
  348. Xcati := $(patsubst %,$(MID)/cat1/%,$(M1S)) $(patsubst %,$(MID)/cat3/%,$(M3S))
  349. X
  350. X# Include files.
  351. Xhi := $(patsubst %,$(HID)/%,$(HS))
  352. X
  353. X# Generated include files.
  354. Xii := $(patsubst %,$(HID)/%,$(it))
  355. X
  356. X# Lint library.
  357. Xlni := $(LNID)/$(LNT)
  358. X
  359. X# Manual entries.
  360. Xm1i := $(patsubst %,$(MID)/man1/%,$(M1S))
  361. Xm3i := $(patsubst %,$(MID)/man3/%,$(M3S))
  362. Xmi  := $(m1i) $(m3i)
  363. X
  364. X# Shared library.
  365. Xsli := $(SLID)/$(SLT)
  366. X
  367. X# TeX and LaTeX macro files.
  368. Xtexi := $(patsubst %,$(TEXID)/%,$(TEXS))
  369. X
  370. X# If making a shared library then compile with -pic option for 
  371. X# position-independent code.
  372. Xifdef SLT
  373. XPIC = -pic
  374. Xendif
  375. X
  376. X# Don't use built-in rules.
  377. X.SUFFIXES:
  378. X.PHONY: clean clobber default dist install install-include \
  379. X    shar test vars $(lt)
  380. X
  381. Xdefault: $(targets)
  382. X
  383. X# Display values of various variables.  Mostly for debugging.
  384. Xvars:
  385. X    @$(ECHO) 'SRCS:' $(SRCS)
  386. X    @$(ECHO) 'INCLUDES:' $(INCLUDES)
  387. X    @$(ECHO) 'BS:' $(BS)
  388. X    @$(ECHO) 'CS:' $(CS)
  389. X    @$(ECHO) 'HS:' $(HS)
  390. X    @$(ECHO) 'M1S:' $(M1S)
  391. X    @$(ECHO) 'M3S:' $(M3S)
  392. X    @$(ECHO) 'SCS:' $(SCS)
  393. X    @$(ECHO) 'allsrc:' $(allsrc)
  394. X    @$(ECHO) 'AT:' $(AT)
  395. X    @$(ECHO) 'bt:' $(bt)
  396. X    @$(ECHO) 'ft:' $(ft)
  397. X    @$(ECHO) 'HT:' $(HT)
  398. X    @$(ECHO) 'LNT:' $(LNT)
  399. X    @$(ECHO) 'lt:' $(lt)
  400. X    @$(ECHO) 'ot:' $(ot)
  401. X    @$(ECHO) 'SLT:' $(SLT)
  402. X    @$(ECHO) 'st:' $(st)
  403. X    @$(ECHO) 'tt:' $(tt)
  404. X    @$(ECHO) 'cflags:' $(cflags)
  405. X    @$(ECHO) 'dist:' $(dist)
  406. X    @$(ECHO) 'ai:' $(ai)
  407. X    @$(ECHO) 'bi:' $(bi)
  408. X    @$(ECHO) 'cati:' $(cati)
  409. X    @$(ECHO) 'hi:' $(hi)
  410. Xifdef FMTLATEX
  411. X    @$(ECHO) 'LATEXS:' $(LATEXS)
  412. X    @$(ECHO) 'BIBS:' $(BIBS)
  413. X    @$(ECHO) 'latext:' $(latext)
  414. X    @$(ECHO) 'spellt:' $(spellt)
  415. Xendif
  416. X    @$(ECHO) 'm1i:' $(m1i)
  417. X    @$(ECHO) 'm3i:' $(m3i)
  418. X    @$(ECHO) 'sli:' $(sli)
  419. X
  420. Xclean:
  421. X    $(RM) depend $(ot) $(st) $(tt)
  422. X
  423. Xclobber: clean
  424. X    $(RM) $(src) $(targets) $(it) FREEZE FREEZE.*
  425. X
  426. X$(lt): %-l: %.c $(LNT)
  427. X    $(LINT) $(LINTFLAGS) -DTEST $(DEFS) $(INCLUDES) $< $(LNT)
  428. X
  429. X$(AT): $(ot)
  430. X    $(RM) $@
  431. X    $(AR) $@ $(ot)
  432. X
  433. Xifdef FMTMAN
  434. X$(ft): %.f: %
  435. X    $(RM) $@
  436. X    $(FMTMAN) $< > $@
  437. Xendif
  438. X
  439. Xifdef FMTLATEX
  440. X$(latext): %.texf: %.tex $(BIBS)
  441. X    $(FMTLATEX) $* $@
  442. X
  443. X$(spellt): %-s: %.tex
  444. X    $(SPELL_LATEX) $<
  445. Xendif
  446. X
  447. X$(LNT): $(CS) $(HS) $(it)
  448. X    $(LINT) -Choward $(INCLUDES) $(CS)
  449. X
  450. X$(ot): %.o: %.c
  451. X    $(CC) -c $(CFLAGS) $(PIC) $(DEFS) $(INCLUDES) $*.c
  452. X
  453. Xifdef SLT
  454. X$(SLT): $(ot)
  455. X    $(RM) $@
  456. X    $(LD) -o $@ $(ot)
  457. X    $(CHMOD) a=r $@
  458. Xendif
  459. X
  460. Xshar: $(allsrc)
  461. X    $(RM) Part[0-9][0-9]
  462. X    $(SHAR) $(allsrc)
  463. X
  464. Xtest: $(tt)
  465. X
  466. X$(tt): %-t: %.c $(AT) $(SLT)
  467. X    $(CC) -o $@ $(TESTCFLAGS) -DTEST $(DEFS) $(INCLUDES) $(LIBPATH) \
  468. X    $*.c $(LIBES)
  469. X
  470. X$(st): %.s: %.c
  471. X    $(CC) -S $(DEFS) $(INCLUDES) $<
  472. X
  473. Xifdef WORK
  474. X
  475. Xdist: $(dist)
  476. X
  477. X$(dist): $(DD)/%: %
  478. X    $(DISTO) $< $(DD)
  479. X
  480. X.DEFAULT:
  481. X    $(UNCMPRS) $@
  482. X
  483. Xelse # WORK
  484. X
  485. Xinstall: install-include $(ai) $(bi) $(cati) \
  486. X         $(lni) $(mi) $(sli) $(texi)
  487. X
  488. Xinstall-include: $(hi) $(ii)
  489. X
  490. X$(ai): $(AT)
  491. X    $(INSTF) $(AT) $(AID)
  492. X
  493. X$(bi): $(BID)/%: %
  494. X    $(INSTF) $< $(BID)
  495. X
  496. Xifdef SLT
  497. X$(sli): $(SLT)
  498. X    $(INSTF) $(SLT) $(SLID)
  499. Xendif
  500. X
  501. X$(lni): $(LNT)
  502. X    $(INSTF) $(LNT) $(LNID)
  503. X
  504. Xifdef CATMAN
  505. X$(cati): $(m1i) $(m3i)
  506. X    $(CATMAN) -M $(MID) 13
  507. Xendif # CATMAN
  508. X
  509. X$(hi): $(HID)/%: %
  510. X    $(INSTF) $< $(HID)
  511. X
  512. X$(ii): $(HID)/%: %
  513. X    $(INSTF) $< $(HID)
  514. X
  515. X$(m1i): $(MID)/man1/%: %
  516. X    $(INSTF) $< $(MID)/man1
  517. X
  518. X$(m3i): $(MID)/man3/%: %
  519. X    $(INSTF) $< $(MID)/man3
  520. X
  521. X$(texi): $(TEXID)/%: %
  522. X    $(INSTF) $< $(TEXID)
  523. X
  524. X$(allsrc): %: $(DD)/%
  525. X    $(DISTI) $@ $(DD)
  526. X
  527. X.DEFAULT:
  528. X    $(DISTI) $@ $(DD)
  529. X
  530. Xendif # WORK
  531. X
  532. Xinclude depend
  533. END_OF_FILE
  534. if test 6702 -ne `wc -c <'Makefile'`; then
  535.     echo shar: \"'Makefile'\" unpacked with wrong size!
  536. fi
  537. # end of 'Makefile'
  538. fi
  539. if test -f 'a2l.c' -a "${1}" != "-c" ; then 
  540.   echo shar: Will not clobber existing file \"'a2l.c'\"
  541. else
  542. echo shar: Extracting \"'a2l.c'\" \(4667 characters\)
  543. sed "s/^X//" >'a2l.c' <<'END_OF_FILE'
  544. X/*
  545. X * a2l - convert Ada-syntax integer literal to long
  546. X */
  547. X
  548. X#ifndef lint
  549. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  550. X#endif lint
  551. X
  552. X/*
  553. X * This program is free software; you can redistribute it and/or modify
  554. X * it under the terms of the GNU General Public License version 1,
  555. X * as published by the Free Software Foundation.
  556. X *
  557. X * This program is distributed in the hope that it will be useful,
  558. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  559. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  560. X * GNU General Public License for more details.
  561. X *
  562. X * You should have received a copy of the GNU General Public License
  563. X * along with this program; if not, write to the Free Software
  564. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  565. X */
  566. X
  567. X#include <stdio.h>
  568. X#include <howard/port.h>
  569. X#include <howard/version.h>
  570. X
  571. XMODVER ("@(#)$Header: a2l.c,v 1.12 89/08/11 13:07:15 howard Exp $");
  572. X
  573. X#include <howard/a2.h>
  574. X#include <howard/registers.i>
  575. X#include <howard/simultipre.i>
  576. X#include <howard/smp.h>
  577. X
  578. XPUBLIC int a2l (str, lim, synok, res, end)
  579. XbStrT  str;   /* Input string.*/
  580. XbStrT  lim;   /* Don't pass this.*/
  581. XboolT  synok; /* Accept non-fatal syntax errors.*/
  582. Xlong  *res;   /* Points to where to store result.*/
  583. XbStrT *end;   /* End pointer stored here.*/
  584. X
  585. X/* Function:
  586. X *    
  587. X * Algorithm:
  588. X *    a2smp() then smp2l()
  589. X * Returns:
  590. X *    
  591. X * Notes:
  592. X *    
  593. X */
  594. X{
  595. XR1 int  s;   /* Return code.*/
  596. X   smpT smp; /* a2smp() stores its result here.*/
  597. X
  598. Xs = a2smp (str, lim, synok, &smp, end);
  599. Xif (SUCCESS == s) s = smp2l (&smp, res);
  600. Xreturn (s);
  601. X}
  602. X
  603. X#ifdef TEST
  604. X#include <howard/usage.h>
  605. X
  606. XMAINVER ("@(#)$Header: a2l.c,v 1.12 89/08/11 13:07:15 howard Exp $");
  607. XUSAGE ("integer-numeric-literal");
  608. X
  609. X#include <errno.h>
  610. X#include <limits.h>
  611. X#include <string.h>
  612. X#include <howard/malf.h>
  613. X
  614. XPRIVATE void t (num, str, limoff, synok, xrc, xres, xendoff)
  615. Xint num; /* Test number.*/
  616. XbStrT str; /* str argument.*/
  617. Xint limoff; /* Limit offset, -1 for none.*/
  618. XboolT synok; /* synok argument.*/
  619. Xint xrc; /* Expected return code.*/
  620. Xlong xres; /* Expected result.*/
  621. Xint xendoff; /* Expected end offset.*/
  622. X{
  623. Xint rc; /* Return code.*/
  624. Xlong res; /* Result stored here.*/
  625. XbStrT end; /* End string stored here.*/
  626. X
  627. Xrc = a2l (str, (limoff < 0) ? NULBSTR : str + limoff, synok, &res, &end);
  628. Xif (rc != xrc) PRINTF ("%d: rc %d expected %d\n", num, rc, xrc);
  629. Xif ((0 == rc) && (0 == xrc) && (res != xres))
  630. X   PRINTF ("%d: res %ld expected %ld\n", num, res, xres);
  631. Xif (xendoff < 0) xendoff = strlen (str);
  632. Xif ((end - str) != xendoff)
  633. X   PRINTF ("%d: end %s expected %s\n", num, end, str + xendoff);
  634. X}
  635. X
  636. XPUBLIC int main (argc, argv)
  637. Xint    argc; /* Number of arguments.*/
  638. XbStrT *argv; /* Points to array of argument strings.*/
  639. X{
  640. XbStrT end; /* End of string.*/
  641. Xlong res; /* a2l() stores its result here.*/
  642. X#define L LONG_MIN
  643. X#define H LONG_MAX
  644. X
  645. X/*num str           limoff syn rc res  end */
  646. Xt(__LINE__,"12",              -1, 0, 0,           12L, -1);
  647. Xt(__LINE__,"0",               -1, 0, 0,            0L, -1);
  648. Xt(__LINE__,"1E6",             -1, 0, 0,      1000000L, -1);
  649. Xt(__LINE__,"2#1111_1111#",    -1, 0, 0,          255L, -1);
  650. Xt(__LINE__,"16#FF#",          -1, 0, 0,          255L, -1);
  651. Xt(__LINE__,"016#0FF#",        -1, 0, 0,          255L, -1);
  652. Xt(__LINE__,"16#E#E1",         -1, 0, 0,          224L, -1);
  653. Xt(__LINE__,"2#1110_0000#",    -1, 0, 0,          224L, -1);
  654. Xt(__LINE__,NULBSTR,            0, 0, EINVAL,       0L,  0);
  655. Xt(__LINE__,"0",                0, 0, EDOM,         0L,  0);
  656. Xt(__LINE__,"012",              1, 0, 0,            0L,  1);
  657. Xt(__LINE__,"_0123",            4, 0, EDOM,        12L,  0);
  658. Xt(__LINE__,"-2_147_483_648",  -1, 0, 0,(long)LONG_MIN, -1);
  659. Xt(__LINE__," \t2_147_483_647",-1, 1, 0,(long)LONG_MAX, -1);
  660. Xt(__LINE__,"1#1111_1111#",    -1, 0, EDOM,         0L,  1);
  661. Xt(__LINE__,"17#1#",           -1, 0, EDOM,         0L,  2);
  662. Xt(__LINE__,"12B",             -1, 1, 0,           12L,  2);
  663. Xt(__LINE__,"16#abcdef#e_0",   -1, 0, EDOM,  0xABCDEFL, 11);
  664. Xt(__LINE__,"16#abcdef#.",     -1, 1, 0,     0xABCDEFL, 10);
  665. Xt(__LINE__,"-2_147_483_649",  -1, 0, ERANGE,       0L, -1);
  666. Xt(__LINE__,"2_147_483_648",   -1, 1, ERANGE,       0L, -1);
  667. X
  668. Xif (2 != argc) usage();
  669. Xswitch (a2l (argv[1], NULBSTR, FALSE, &res, &end))
  670. X   {
  671. X   case SUCCESS:
  672. X      PRINTF ("8#%lo#\t10#%ld#\t16#%lX#\n", res, res, res);
  673. X      break;
  674. X   case EINVAL:
  675. X      PRINTF ("EINVAL %s\n", end);
  676. X      break;
  677. X   case EDOM:
  678. X      PRINTF ("EDOM %s\n", end);
  679. X      break;
  680. X   case ERANGE:
  681. X      PRINTF ("ERANGE %s\n", end);
  682. X      break;
  683. X   default:
  684. X      PUTS ("Unexpected return");
  685. X      break;
  686. X   }
  687. Xmfflush (stdout, "Standard Output");
  688. Xexit (SUCCESS);
  689. X
  690. X#ifdef lint
  691. Xreturn (SUCCESS);
  692. X#endif
  693. X}
  694. X#endif
  695. END_OF_FILE
  696. if test 4667 -ne `wc -c <'a2l.c'`; then
  697.     echo shar: \"'a2l.c'\" unpacked with wrong size!
  698. fi
  699. # end of 'a2l.c'
  700. fi
  701. if test -f 'getlic.c' -a "${1}" != "-c" ; then 
  702.   echo shar: Will not clobber existing file \"'getlic.c'\"
  703. else
  704. echo shar: Extracting \"'getlic.c'\" \(5666 characters\)
  705. sed "s/^X//" >'getlic.c' <<'END_OF_FILE'
  706. X/*
  707. X * getlic - read next line from a file, stripping comments & blank lines
  708. X */
  709. X
  710. X#ifndef lint
  711. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  712. X#endif lint
  713. X
  714. X/*
  715. X * This program is free software; you can redistribute it and/or modify
  716. X * it under the terms of the GNU General Public License version 1,
  717. X * as published by the Free Software Foundation.
  718. X *
  719. X * This program is distributed in the hope that it will be useful,
  720. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  721. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  722. X * GNU General Public License for more details.
  723. X *
  724. X * You should have received a copy of the GNU General Public License
  725. X * along with this program; if not, write to the Free Software
  726. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  727. X */
  728. X
  729. X#include <stdio.h>
  730. X#include <howard/port.h>
  731. X#include <howard/version.h>
  732. X
  733. XMODVER ("@(#)$Header: getlic.c,v 1.5 89/08/09 09:46:01 howard Exp $");
  734. X
  735. X#include <howard/registers.i>
  736. X#include <howard/malf.h>
  737. X
  738. XPUBLIC bStrT getlic (l, ls, f, fn, ln, tw, com)
  739. XbStrT     l;    /* Points to buffer provided by caller where line
  740. X         * will be stored.*/
  741. Xunsigned  ls;   /* Number of bytes in buffer, including terminal
  742. X         * NUL.  (No space needs to be provided for the
  743. X         * newline since getlin removes it.)*/
  744. XstreamT   f;    /* Input stream.*/
  745. XbStrT     fn;   /* Input file name, for possible error messages.*/
  746. Xunsigned *ln;   /* Points to where current line number is stored.
  747. X         * getlin increments it after a successful read, and
  748. X         * uses it for error messages.*/
  749. XR5 unsigned tw; /* Expand tabs into this many spaces.  0 = no expand.*/
  750. XR4 rcharT com;  /* Character that starts comments to end of line.*/
  751. X
  752. X/* Function:
  753. X *    Read one nonblank line.  Strip comments.  Handle errors.
  754. X * Algorithm:
  755. X *    Read one character at a time until
  756. X *       1) a non-empty line is received,
  757. X *     2) an EOF is received, or
  758. X *     3) the buffer becomes full.
  759. X * Returns:
  760. X *    On success, a pointer to the NUL terminator in l[].
  761. X *    On normal EOF, NULBSTR.
  762. X *    No return on error.
  763. X */
  764. X
  765. X{
  766. XR1 rcharT c;             /* Current input character.*/
  767. XbStrT     bp    = l;     /* Current position in line buffer.*/
  768. Xunsigned  col   = 0;     /* Current column number (leftmost 0).*/
  769. XR3 boolT  incom = FALSE; /* Set inside comments.*/
  770. XR2 boolT  more  = TRUE;  /* Set when more to do.*/
  771. X
  772. Xif ((NULBSTR == fn) || (EOS == B(*fn))) malf1 ("getlin: No file name");
  773. Xif (NULBSTR == l) malf1 ("getlin %s: No line buffer", fn);
  774. Xif (ls < 2) malf1 ("getlin %s: Line buffer too small", fn);
  775. Xif (NULSTRM == f) malf1 ("getlin %s: No FILE", fn);
  776. Xif (((unsigned *) NULL) == ln) malf1 ("getlin %s: No line number pointer", fn);
  777. Xdo
  778. X   {
  779. X   c = getc (f);
  780. X   if (incom)
  781. X      {
  782. X      switch (c)
  783. X         {
  784. X         case '\n':
  785. X            if (bp == l)
  786. X               incom = FALSE;
  787. X            else
  788. X               more = FALSE;
  789. X            ++(*ln);
  790. X            break;
  791. X         case EOF:
  792. X            if (ferror (f)) malf1 ("%s: %u: Read error", fn, 1 + *ln);
  793. X            if (bp != l)
  794. X               malf1 ("%s: %u: End of file in middle of line", fn, 1 + *ln);
  795. X            *bp = EOS;
  796. X            bp = NULBSTR;
  797. X            more = FALSE;
  798. X            break;
  799. X         case EOS:  /* NUL.*/
  800. X            malf1 ("%s: %u: NUL in line", fn, 1 + *ln);
  801. X            break;
  802. X         default:
  803. X            break;
  804. X         }
  805. X      }
  806. X   else
  807. X      {
  808. X      switch (c)
  809. X         {
  810. X         case '\t':
  811. X            if (0 == tw)
  812. X               {
  813. X               *bp++ = c;
  814. X               ++col;
  815. X               }
  816. X            else
  817. X               {
  818. X               c = tw - (col % tw);
  819. X               col += c;
  820. X               if (col < ls)
  821. X                  while (c--)
  822. X                     *bp++ = ' ';
  823. X               }
  824. X            break;
  825. X         case '\n':
  826. X            if (bp != l)
  827. X               {
  828. X               --bp;
  829. X               while ((bp >= l) && ((' ' == B(*bp)) || ('\t' == B(*bp))))
  830. X                  --bp;
  831. X               ++bp;
  832. X               *bp = EOS;
  833. X               }
  834. X            ++(*ln);
  835. X            if (bp != l) more = FALSE;
  836. X            break;
  837. X         case EOF:
  838. X            if (ferror (f)) malf1 ("%s: %u: Read error", fn, 1 + *ln);
  839. X            if (bp != l)
  840. X               malf1 ("%s: %u: End of file in middle of line", fn, 1 + *ln);
  841. X            *bp = EOS;
  842. X            bp = NULBSTR;
  843. X            more = FALSE;
  844. X            break;
  845. X         case EOS:  /* NUL.*/
  846. X            malf1 ("%s: %u: NUL in line", fn, 1 + *ln);
  847. X            break;
  848. X         default:
  849. X            if (c == com)
  850. X               {
  851. X               if (bp != l)
  852. X                  {
  853. X                  --bp;
  854. X                  while ((bp >= l) && ((' ' == B(*bp)) || ('\t' == B(*bp))))
  855. X                     --bp;
  856. X                  ++bp;
  857. X                  *bp = EOS;
  858. X                  }
  859. X               ++incom;
  860. X               }
  861. X            else
  862. X               {
  863. X               *bp++ = c;
  864. X               ++col;
  865. X               }
  866. X            break;
  867. X         }
  868. X      }
  869. X   if (col >= ls) malf1 ("%s: %u: Line too long, %u max", fn, 1 + *ln, ls - 1);
  870. X   }
  871. Xwhile (more);
  872. Xreturn (bp);
  873. X}
  874. X
  875. X
  876. X#ifdef TEST
  877. X/* This test driver copies stdin to stdout, stripping comments starting
  878. X * with the given argument.*/
  879. X#include <howard/usage.h>
  880. X
  881. XMAINVER ("@(#)$Header: getlic.c,v 1.5 89/08/09 09:46:01 howard Exp $");
  882. XUSAGE ("comment-character");
  883. X
  884. XPUBLIC int main (argc, argv)
  885. Xint    argc; /* Number of arguments.*/
  886. XbStrT *argv; /* Points to array of argument strings.*/
  887. X{
  888. Xunsigned     ln = 0;
  889. Xstatic byteT l[1024];
  890. X
  891. Xif ((2 != argc) || (EOS != argv[1][1])) usage();
  892. Xwhile (NULBSTR != getlic (l, 1024, stdin, "Standard Input", &ln, 8,
  893. X                          argv[1][0]))
  894. X   PUTS (l);
  895. X}
  896. X#endif
  897. END_OF_FILE
  898. if test 5666 -ne `wc -c <'getlic.c'`; then
  899.     echo shar: \"'getlic.c'\" unpacked with wrong size!
  900. fi
  901. # end of 'getlic.c'
  902. fi
  903. if test -f 'malf.3' -a "${1}" != "-c" ; then 
  904.   echo shar: Will not clobber existing file \"'malf.3'\"
  905. else
  906. echo shar: Extracting \"'malf.3'\" \(4916 characters\)
  907. sed "s/^X//" >'malf.3' <<'END_OF_FILE'
  908. X.\" @(#)$Header: malf.3,v 1.11 89/08/14 09:06:30 howard Exp $
  909. X.TH MALF "3 -lhoward" "$Revision: 1.11 $" "Howard\'s C library" "Howard\'s C library"
  910. X.SH NAME
  911. Xmalf, malf0, malf1, mcalloc, mfclose, mfflush, mfopen, mfseek \- write error message
  912. X.SH SYNOPSIS
  913. X.nf
  914. X.BR "#include <" stdio.h ">"
  915. X.BR "#include <" howard/port.h ">"
  916. X.BR "#include <" howard/version.h ">"
  917. X.LP
  918. X.RI "MAINVER (" version ");"
  919. X.LP
  920. X.BR "#include <" howard/malf.h ">"
  921. X.fi
  922. X.LP
  923. X.BR "void " "malf ("
  924. X.IR exitcode ", " format "[, " arg ".\|.\|.])"
  925. X.nf
  926. X.BI "int " exitcode ";"
  927. X.RI "cStrT " format ";"
  928. X.fi
  929. X.LP
  930. X.BR "void " "malf0 ("
  931. X.IR format "[, " arg ".\|.\|.])"
  932. X.nf
  933. X.RI "cStrT " format ";"
  934. X.fi
  935. X.LP
  936. X.BR "void " "malf1 ("
  937. X.IR format "[, " arg ".\|.\|.])"
  938. X.nf
  939. X.RI "cStrT " format ";"
  940. X.fi
  941. X.LP
  942. XvoidPT mcalloc (
  943. X.IR nelem ,
  944. X.IR elsize ,
  945. X.IR what )
  946. X.nf
  947. X.BI "unsigned " nelem;
  948. X.BI "unsigned " elsize;
  949. X.RI "bStrT " what;
  950. X.fi
  951. X.LP
  952. X.BR "void " "mfclose ("
  953. X.IR stream ", " filename ")"
  954. X.nf
  955. X.RI "streamT " stream ";"
  956. X.RI "bStrT " filename ";"
  957. X.fi
  958. X.LP
  959. X.BR "void " "mfflush ("
  960. X.IR stream ", " filename ")"
  961. X.nf
  962. X.RI "streamT " stream ";"
  963. X.RI "bStrT " filename ";"
  964. X.fi
  965. X.LP
  966. X.RI "streamT mfopen (" filename ", " type ")"
  967. X.nf
  968. X.RI "bStrT " filename ";"
  969. X.RI "bStrT " type ";"
  970. X.fi
  971. X.LP
  972. X.BR "void " "mfseek ("
  973. X.IR stream ,
  974. X.IR offset ,
  975. X.IR ptrname ,
  976. X.IR filename )
  977. X.nf
  978. X.RI "streamT " stream ";"
  979. X.BI "long " offset;
  980. X.BI "int " ptrname;
  981. X.RI "bStrT " filename ";"
  982. X.fi
  983. X.SH COPYRIGHT
  984. XCopyright \(co 1989 Howard Lee Gayle
  985. X.SH DESCRIPTION
  986. X.I Malf
  987. Xwrites on standard error a message with the syntax:
  988. X.nf
  989. X   <type> message at <time>
  990. X      from: <program>
  991. X      <message>
  992. X      System message <error number>: <error text>
  993. X.fi
  994. XIf standard error is a terminal,
  995. Xthen the first three lines of the message are abridged to:
  996. X.nf
  997. X   <type>: <program>: <message>
  998. X.fi
  999. XThe message fields are:
  1000. X.nr xx (\w'error number'u+2n)/1n
  1001. X.TP \n(xx
  1002. X.I type
  1003. X"Warning" if
  1004. X.I exitcode
  1005. Xis zero, otherwise "Error."
  1006. X.TP
  1007. X.I time
  1008. XThe date and time
  1009. X.I malf
  1010. Xis called.
  1011. X.TP
  1012. X.I program
  1013. XThe name of the program,
  1014. Xwritten by
  1015. X.IR putspn (3).
  1016. X.TP
  1017. X.P message
  1018. XThe result of passing the format string and any arguments
  1019. Xto
  1020. X.I [v]fprintf.
  1021. X.TP
  1022. X.I "error number"
  1023. XThe decimal value of the system global
  1024. X.IR errno ";"
  1025. Xthe
  1026. X"System message" line is printed only when
  1027. X.I errno
  1028. Xis nonzero.
  1029. X.TP
  1030. X.I "error text"
  1031. XThe text corresponding to errno, if it exists.
  1032. X.PP
  1033. X.I malf0
  1034. Xis identical to
  1035. X.I malf
  1036. Xwith a first argument of zero.
  1037. X.I malf1
  1038. Xis identical to
  1039. X.I malf
  1040. Xwith a first argument of one.
  1041. X.PP
  1042. X.I mcalloc
  1043. X.RI ( nelem ,
  1044. X.IR elsize ,
  1045. X.IR what )
  1046. Xcalls
  1047. X.I calloc
  1048. X.RI ( nelem ,
  1049. X.IR elsize ).
  1050. XOn error, it calls
  1051. X.I malf1
  1052. Xusing
  1053. X.I what
  1054. Xin the error message to identify what could not be allocated.
  1055. X.PP
  1056. X.I mfclose
  1057. X.RI ( stream ", " filename ")"
  1058. Xcalls
  1059. X.I fclose
  1060. X.RI ( stream ).
  1061. XOn error, it calls
  1062. X.I malf1
  1063. Xusing
  1064. X.I filename
  1065. Xin the error message.
  1066. X.PP
  1067. X.I mfflush
  1068. X.RI ( stream ", " filename ")"
  1069. Xcalls
  1070. X.I fflush
  1071. X.RI ( stream ).
  1072. XOn error, it calls
  1073. X.I malf1
  1074. Xusing
  1075. X.I filename
  1076. Xin the error message.
  1077. X.PP
  1078. X.I mfopen
  1079. Xis equivalent to
  1080. X.IR fopen (3),
  1081. Xexcept that it calls
  1082. X.I malf1
  1083. Xon error.
  1084. X.PP
  1085. X.I mfseek
  1086. X.RI ( stream ,
  1087. X.IR offset ,
  1088. X.IR ptrname ,
  1089. X.IR filename )
  1090. Xcalls
  1091. X.I fseek
  1092. X.RI ( stream ,
  1093. X.IR offset ,
  1094. X.IR ptrname ).
  1095. XOn error, it calls
  1096. X.I malf1
  1097. Xusing
  1098. X.I filename
  1099. Xin the error message.
  1100. X.SH RETURNS
  1101. XIf
  1102. X.I exitcode
  1103. Xis nonzero, then
  1104. X.I malf
  1105. Xdoes not return but terminates the program.
  1106. XIf the global Boolean variable _debug is TRUE,
  1107. X.I malf
  1108. Xterminates by calling
  1109. X.IR abort (2),
  1110. Xwhich causes a core dump.
  1111. XOtherwise,
  1112. X.I malf
  1113. Xpasses
  1114. X.I exitcode
  1115. Xto
  1116. X.IR exit (2).
  1117. X.PP
  1118. XIf
  1119. X.I exitcode
  1120. Xis zero, then
  1121. X.I malf
  1122. Xzeros
  1123. X.I errno
  1124. Xbefore it returns.
  1125. X.SH EXAMPLE
  1126. X.nf
  1127. X   if (unlink (f)) malf (2, "%s: Can not unlink", f);
  1128. X.fi
  1129. X.SH "SEE ALSO"
  1130. X.IR rcs (1),
  1131. X.IR sccs (1),
  1132. X.IR intro (2),
  1133. X.IR abort (2),
  1134. X.IR exit (2),
  1135. X.IR fclose (3S),
  1136. X.IR fflush (3S),
  1137. X.IR fopen (3S),
  1138. X.IR fseek (3S),
  1139. X.IR malloc (3),
  1140. X.IR perror (3),
  1141. X.IR printf (3S),
  1142. X.IR putspn "(3 \-lhoward),"
  1143. X.IR syslog (3),
  1144. X.IR vfprintf (3S).
  1145. X.SH ETYMOLOGY
  1146. XThe word "malf,"
  1147. Xpresumably short for malfunction,
  1148. Xoccurs in Gregory Benford's book
  1149. X.I Across the sea of suns
  1150. X.RI ( e.g.
  1151. Xon page 319).
  1152. XIt can be used as a noun or a verb.
  1153. X.SH LICENSE
  1154. XThis program is free software; you can redistribute it and/or modify
  1155. Xit under the terms of the GNU General Public License version 1,
  1156. Xas published by the Free Software Foundation.
  1157. X.PP
  1158. XThis program is distributed in the hope that it will be useful,
  1159. Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
  1160. XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1161. XGNU General Public License for more details.
  1162. X.PP
  1163. XYou should have received a copy of the GNU General Public License
  1164. Xalong with this program; if not, write to the Free Software
  1165. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1166. X.SH AUTHOR
  1167. XHoward Gayle,
  1168. XTN/ETX/T/BG,
  1169. XEricsson Telecom AB,
  1170. XS-126 25 Stockholm,
  1171. XSweden,
  1172. Xhoward@ericsson.se,
  1173. Xuunet!ericsson.se!howard,
  1174. XPhone: +46 8 719 5565,
  1175. XFAX: +46 8 719 9598,
  1176. XTelex: 14910 ERIC S
  1177. END_OF_FILE
  1178. if test 4916 -ne `wc -c <'malf.3'`; then
  1179.     echo shar: \"'malf.3'\" unpacked with wrong size!
  1180. fi
  1181. # end of 'malf.3'
  1182. fi
  1183. if test -f 'mk-smp.c' -a "${1}" != "-c" ; then 
  1184.   echo shar: Will not clobber existing file \"'mk-smp.c'\"
  1185. else
  1186. echo shar: Extracting \"'mk-smp.c'\" \(6522 characters\)
  1187. sed "s/^X//" >'mk-smp.c' <<'END_OF_FILE'
  1188. X/*
  1189. X * mk-smp - make simultipre.i include file for SMP
  1190. X */
  1191. X
  1192. X#ifndef lint
  1193. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  1194. X#endif lint
  1195. X
  1196. X/*
  1197. X * This program is free software; you can redistribute it and/or modify
  1198. X * it under the terms of the GNU General Public License version 1,
  1199. X * as published by the Free Software Foundation.
  1200. X *
  1201. X * This program is distributed in the hope that it will be useful,
  1202. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1203. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1204. X * GNU General Public License for more details.
  1205. X *
  1206. X * You should have received a copy of the GNU General Public License
  1207. X * along with this program; if not, write to the Free Software
  1208. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1209. X */
  1210. X
  1211. X#include <stdio.h>
  1212. X#include <limits.h>
  1213. X#include <string.h>
  1214. X
  1215. X/* clbs - compute bits needed to hold octal representation of integer */
  1216. X
  1217. Xint clbs (s)
  1218. Xchar *s; /* String holding octal representation of number.*/
  1219. X
  1220. X/* Function:
  1221. X *    Compute ceiling (log2 (n)), where log2 is log to base 2, and n
  1222. X *    is a non-negative integer whose octal string representation is in s.
  1223. X * Algorithm:
  1224. X *    Count the digits.  The first requires a switch to see if it's
  1225. X *    1, 2, or 3 bits.
  1226. X * Returns:
  1227. X *    Number of bits to hold n.
  1228. X * Notes:
  1229. X *    1) Assumes no leading digits.
  1230. X *    2) s would normally be the result of a sprintf().
  1231. X *    3) What a hack!  But it really works.
  1232. X */
  1233. X{
  1234. Xint i = 3 * strlen (s);
  1235. X
  1236. Xswitch (*s)
  1237. X   {
  1238. X   case '1':
  1239. X      return (i - 2);
  1240. X   case '2':
  1241. X   case '3':
  1242. X      return (i - 1);
  1243. X   case '4':
  1244. X   case '5':
  1245. X   case '6':
  1246. X   case '7':
  1247. X      return (i);
  1248. X   default:
  1249. X      fprintf (stderr, "mk-smp: clbs: impossible input %s", s);
  1250. X      exit (1);
  1251. X   }
  1252. X/*NOTREACHED*/
  1253. X}
  1254. X
  1255. X/* main - main function                            */
  1256. X
  1257. Xint main ()
  1258. X
  1259. X/* Function:
  1260. X *    
  1261. X * Algorithm:
  1262. X *    Compute the bits needed to repesent the maximum long (clbl),
  1263. X *    unsigned (clbu), and unsigned long (clbul).  Each SMP element
  1264. X *    is an unsigned.  The number of useable bits in an element (eb) is
  1265. X *    thus clbu minus the number of bits for SMPRDX minus one guard
  1266. X *    bit.  The number of elements to hold a long is ceiling (clbl/eb).
  1267. X *    SMPLMIN is the SMP representation of the most negative long.
  1268. X *    On a two's complement machine, this is just 1 followed by the
  1269. X *    right number of zeros.  Otherwise, it is generated by breaking
  1270. X *    apart LONG_MAX.
  1271. X * Notes:
  1272. X *    1) The Makefile should define SMPRDX to be the maximum radix
  1273. X *       argument to smpdig().
  1274. X *    2) If the number of elements for all types is 2, and clbu is even,
  1275. X *       then eb is special-cased to half of clbu for esthetic reasons.
  1276. X *    3) This code should even work on a sign-magnitude machine, if there
  1277. X *       are any.
  1278. X */
  1279. X
  1280. X{
  1281. Xint      clbl;             /* ceil (log2 (LONG_MAX)).*/
  1282. Xint      clbr;             /* ceil (log2 (SMPRDX^%)).*/
  1283. Xint      clbu;             /* ceil (log2 (UINT_MAX)).*/
  1284. Xint      clbul;            /* ceil (log2 (ULONG_MAX)).*/
  1285. Xint      eb;               /* SMPEB, the number of bits used in each element.*/
  1286. Xint      i;                /* Counter.*/
  1287. Xlong     l;                /* Used to generate SMPLMIN.*/
  1288. Xint      lhb;              /* SMPLHB.*/
  1289. Xunsigned mask = 1;         /* SMPMASK.*/
  1290. Xint      mhb;              /* SMPMHB.*/
  1291. Xint      nel;              /* SMPNEL.*/
  1292. Xint      nl;               /* SMPNL.*/
  1293. Xint      nul;              /* SMPNUL.*/
  1294. Xint      ulhb;             /* SMPULHB.*/
  1295. Xint      nu;               /* SMPNU.*/
  1296. Xint      uhb;              /* SMPUHB.*/
  1297. Xchar     b[(256 / 3) + 2]; /* Output buffer for sprintf (3).*/
  1298. X
  1299. Xsprintf (b, "%o", UINT_MAX);
  1300. Xclbu = clbs (b);
  1301. Xif (clbu < 3)
  1302. X   {
  1303. X   fprintf (stderr, "Unsigned ints are only %d bits!", clbu);
  1304. X   exit (1);
  1305. X   }
  1306. Xif (SMPRDX < 10)
  1307. X   {
  1308. X   fprintf (stderr, "SMPRDX is only %d!", SMPRDX);
  1309. X   exit (1);
  1310. X   }
  1311. Xsprintf (b, "%o", SMPRDX);
  1312. Xclbr = clbs (b);
  1313. Xsprintf (b, "%lo", LONG_MAX);
  1314. Xclbl = 1 + clbs (b); /* Add 1 bit for sign bit.*/
  1315. Xsprintf (b, "%lo", ULONG_MAX);
  1316. Xclbul = clbs (b);
  1317. Xeb = clbu - clbr - 1;
  1318. Xif (eb < 1)
  1319. X   {
  1320. X   fprintf (stderr,
  1321. X            "Unsigned ints are only %d bits, so SMPRDX can be at most %d\n",
  1322. X            clbu, 1 << (clbu - 2));
  1323. X   exit (1);
  1324. X   }
  1325. Xnl = (clbl + eb - 1) / eb;
  1326. Xnu = 2;
  1327. Xnul = (clbul + eb - 1) / eb;
  1328. Xnel = ((nl > nul) ? nl : nul);
  1329. Xif ((2 == nl) && (2 == nu) && (2 == nul) &&
  1330. X    (0 == (clbu % 2)) && ((clbu / 2) >= (clbr + 1)))
  1331. X   eb = clbu / 2;
  1332. Xmask = (mask << eb) - 1;
  1333. Xlhb = clbl - 1 - (nel - 1) * eb;
  1334. Xuhb = clbu - (nel - 1) * eb;
  1335. Xulhb = clbul - (nel - 1) * eb;
  1336. Xmhb = ((lhb > ulhb) ? lhb : ulhb);
  1337. Xputs ("/*");
  1338. Xputs (" * simultipre.i - Macros for simple multiple precision (SMP) system");
  1339. Xputs (" *");
  1340. Xputs (" * This file was generated automatically by:");
  1341. Xputs (" *\t$Header: mk-smp.c,v 1.5 89/08/15 14:25:55 howard Exp $");
  1342. Xputs (" *");
  1343. Xprintf (" * Longs need %d bits.\n", clbl);
  1344. Xprintf (" * Unsigned longs need %d bits.\n", clbul);
  1345. Xprintf (" * Unsigned ints need %d bits.\n", clbu);
  1346. Xprintf (" * This is %sa two's complement machine.\n",
  1347. X        ((- LONG_MAX) == LONG_MIN) ? "not " : "");
  1348. Xputs (" */");
  1349. Xputchar ('\n');
  1350. Xprintf (
  1351. X   "#define SMPRDX  %6d /* Maximum radix of number to convert to SMP.*/\n",
  1352. X   SMPRDX);
  1353. Xprintf ("#define SMPEB   %6d /* Number of bits in one SMP element.*/\n", eb);
  1354. Xprintf ("#define SMPMASK 0x%X /* Mask off SMPEB bits.*/\n", mask);
  1355. Xprintf ("#define SMPMHB  %6d /* Number of bits in high order SMP element.*/\n",
  1356. X        mhb);
  1357. Xprintf ("#define SMPNEL  %6d /* Number of SMP elements to make one SMP.*/\n",
  1358. X        nel);
  1359. Xprintf ("#define SMPNL   %6d /* Number of SMP elements for a long.*/\n", nl);
  1360. Xprintf (
  1361. X       "#define SMPLHB  %6d /* Number of bits in high order long element.*/\n",
  1362. X       lhb);
  1363. Xprintf ("#define SMPLMIN {");
  1364. Xif ((- LONG_MAX) == LONG_MIN)
  1365. X   { /* Not two's complement.*/
  1366. X   l = LONG_MAX;
  1367. X   for (i = nel; 0 != i; --i)
  1368. X      {
  1369. X      printf ("0x%lX, ", l & mask);
  1370. X      l >>= eb;
  1371. X      }
  1372. X   }
  1373. Xelse
  1374. X   { /* Two's complement.*/
  1375. X   for (i = nel - 1; 0 != i; --i)
  1376. X      printf ("0, ");
  1377. X   printf ("0x%X, ", 1 << lhb);
  1378. X   }
  1379. Xputs ("1} /* SMP for LONG_MIN.*/");
  1380. Xprintf ("#define SMPNU   %6d /* Number of SMP elements for unsigned int.*/\n",
  1381. X        nu);
  1382. Xprintf (
  1383. X"#define SMPUHB  %6d /* Number of bits in high order unsigned int element.*/\n",
  1384. X        uhb);
  1385. Xprintf ("#define SMPNUL  %6d /* Number of SMP elements for unsigned long.*/\n",
  1386. X        nul);
  1387. Xprintf (
  1388. X"#define SMPULHB %6d /* Number of bits in high order unsigned long element.*/\n",
  1389. X        ulhb);
  1390. X
  1391. Xfflush (stdout);
  1392. Xexit (0);
  1393. X
  1394. X#ifdef lint
  1395. Xreturn (0);
  1396. X#endif
  1397. X}
  1398. END_OF_FILE
  1399. if test 6522 -ne `wc -c <'mk-smp.c'`; then
  1400.     echo shar: \"'mk-smp.c'\" unpacked with wrong size!
  1401. fi
  1402. # end of 'mk-smp.c'
  1403. fi
  1404. if test -f 'new-Make.b' -a "${1}" != "-c" ; then 
  1405.   echo shar: Will not clobber existing file \"'new-Make.b'\"
  1406. else
  1407. echo shar: Extracting \"'new-Make.b'\" \(6860 characters\)
  1408. sed "s/^X//" >'new-Make.b' <<'END_OF_FILE'
  1409. X  
  1410. X# new-Make.b - create a new Makefile from a prototype
  1411. X#
  1412. X# $Header: new-Make.b,v 1.2 89/09/23 15:24:04 howard Exp $
  1413. X#
  1414. X# Copyright 1989 Howard Lee Gayle
  1415. X# This file is written in the ISO 8859/1 character set.
  1416. X#
  1417. X# This program is free software; you can redistribute it and/or modify
  1418. X# it under the terms of the GNU General Public License version 1,
  1419. X# as published by the Free Software Foundation.
  1420. X#
  1421. X# This program is distributed in the hope that it will be useful,
  1422. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  1423. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1424. X# GNU General Public License for more details.
  1425. X#
  1426. X# You should have received a copy of the GNU General Public License
  1427. X# along with this program; if not, write to the Free Software
  1428. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1429. X#
  1430. X# Shell variables:
  1431. X# c - '#'
  1432. X# d - '$'
  1433. X# f - steps through files to create
  1434. X# u - usage string
  1435. X
  1436. XCMDNAME=new-Make
  1437. Xexport CMDNAME
  1438. Xu="Usage: $CMDNAME file..."
  1439. Xif [ $# -eq 0 ]
  1440. Xthen
  1441. X   echo "$u" 1>&2
  1442. X   exit 1
  1443. Xfi
  1444. Xc='#'
  1445. Xd='$'
  1446. Xfor f
  1447. Xdo
  1448. X   cat << EOF > "$f"
  1449. X$c $f - main GNU makefile for ~
  1450. X$c
  1451. X$c ${d}Header$d
  1452. X$c
  1453. XEOF
  1454. X   if [ "$NEWTEXTPATH" ]
  1455. X   then
  1456. X      cat-path "$NEWTEXTPATH" new.txt | sed -e "s;^;$c ;" >> "$f"
  1457. X   fi
  1458. X   cat << 'EOF' >> "$f"
  1459. X
  1460. Xinclude MakeCommon
  1461. X
  1462. X# Commands:
  1463. X
  1464. X# Copy stdin to stdout.
  1465. XCAT=cat
  1466. X
  1467. X# Put a file into the distribution directory.
  1468. XDISTO=mkDistO
  1469. X
  1470. X# Echo arguments.
  1471. XECHO=echo
  1472. X
  1473. X# Elisp compiler.
  1474. XELCMP=emacs -batch -q -f batch-byte-compile
  1475. X
  1476. X# Install a non-executable file.
  1477. XINSTF=mkInstF
  1478. X
  1479. X# Install an executable file.
  1480. XINSTX=mkInstX
  1481. X
  1482. X# Lint command.
  1483. XLINT=lint
  1484. X
  1485. X# Make shar files.
  1486. XSHAR=trshar shar
  1487. X
  1488. X
  1489. X# Command options:
  1490. X
  1491. X# Set commands at start of Bourne shell files, usually absolute paths.
  1492. XBDEFS=
  1493. X
  1494. X# C compiler options.
  1495. XCFLAGS=-O4
  1496. X
  1497. X# C library search path.
  1498. XLIBPATH=-L/usr/local/free/howard/0
  1499. X
  1500. X# C libraries to link in.
  1501. XLIBES=-lhoward
  1502. X
  1503. X# Options to lint.
  1504. XLINTFLAGS=-abchux
  1505. X
  1506. X# Lint libraries.
  1507. XLL=/usr/local/free/howard/0/llib-howard.ln
  1508. X
  1509. X
  1510. X# Directories:
  1511. X
  1512. X# Install Bourne shell files here.
  1513. XBID=../bin
  1514. X
  1515. X# Install C executables here.
  1516. XCID=../bin
  1517. X
  1518. X# Install compiled elisp here.
  1519. XELID=../el
  1520. X
  1521. X# Install man entries here.
  1522. XMID=../man
  1523. X
  1524. X
  1525. X# Sources.  Comment out all that don't apply.
  1526. X
  1527. X# Bourne shell files.
  1528. XBS := $(filter %.b,$(SRCS))
  1529. X
  1530. X# BibTeX bibliography file.
  1531. XBIBS := $(filter %.bib,$(SRCS))
  1532. X
  1533. X# C programs.
  1534. XCS := $(filter %.c,$(SRCS))
  1535. X
  1536. X# Elisp source.
  1537. XELS := $(filter %.el,$(SRCS))
  1538. X
  1539. X# C include files.
  1540. XHS := $(filter %.h,$(SRCS))
  1541. X
  1542. X# LaTeX source.
  1543. XLATEXS := $(filter %.tex,$(SRCS))
  1544. X
  1545. X# Manuals.
  1546. XM1S := $(filter %.1,$(SRCS))# Section 1.
  1547. XM5S := $(filter %.5,$(SRCS))# Section 5.
  1548. XM8S := $(filter %.8,$(SRCS))# Section 8.
  1549. Xms  := $(M1S) $(M5S) $(M8S)# All sections.
  1550. X
  1551. X# All ordinary source files.  Removed by make clobber.
  1552. Xsrc := $(BS) $(BIBS) $(CS) $(ELS) $(HS) $(LATEXS) $(ms)
  1553. X
  1554. X# Absolutely all source files.
  1555. Xallsrc := README LICENSE FREEZE MakeCommon Makefile uMakefile $(src)
  1556. X
  1557. X
  1558. X# Targets and installs:
  1559. X
  1560. X# Bourne shell files.
  1561. Xifdef BS
  1562. Xbt := $(subst .b,,$(BS))
  1563. Xbi := $(patsubst %,$(BID)/%,$(bt))
  1564. Xendif
  1565. X
  1566. X# C programs.
  1567. Xifdef CS
  1568. Xct := $(subst .c,,$(CS))
  1569. Xci := $(patsubst %,$(CID)/%,$(ct))
  1570. Xlt := $(patsubst %.c,%-l,$(CS))# Phony lint targets for C programs.
  1571. Xst := $(subst .c,.s,$(CS))# Assembler targets for C programs.
  1572. Xendif
  1573. X
  1574. X# Compiled elisp.
  1575. Xifdef ELS
  1576. Xelt := $(subst .el,.elc,$(ELS))
  1577. Xeli := $(patsubst %,$(ELID)/%,$(elt))
  1578. Xendif
  1579. X
  1580. X# LaTeX.
  1581. Xifdef FMTLATEX
  1582. Xlatext := $(subst .tex,.texf,$(LATEXS))
  1583. Xspellt := $(patsubst %.tex,%-s,$(LATEXS))#Phony targets for spelling checking.
  1584. Xendif
  1585. X
  1586. X# Manual entries.
  1587. Xifdef M1S
  1588. Xcat1i := $(patsubst %,$(MID)/cat1/%,$(M1S))
  1589. Xm1i   := $(patsubst %,$(MID)/man1/%,$(M1S))
  1590. Xendif
  1591. Xifdef M5S
  1592. Xcat5i := $(patsubst %,$(MID)/cat5/%,$(M5S))
  1593. Xm5i   := $(patsubst %,$(MID)/man5/%,$(M5S))
  1594. Xendif
  1595. Xifdef M8S
  1596. Xcat8i := $(patsubst %,$(MID)/cat8/%,$(M8S))
  1597. Xm8i   := $(patsubst %,$(MID)/man8/%,$(M8S))
  1598. Xendif
  1599. Xcati := $(cat1i) $(cat5i) $(cat8i)
  1600. Xmi   := $(m1i) $(m5i) $(m8i)
  1601. X
  1602. Xifdef FMTMAN
  1603. Xft := $(patsubst %,%.f,$(ms))#Formatted manual entries, e.g. PostScript.
  1604. Xendif
  1605. X
  1606. Xtargets := $(bt) $(ct) $(elt) $(ft) $(latext)
  1607. X
  1608. X# Distribution:
  1609. Xdist := $(patsubst %,$(DD)/%,$(allsrc) $(ft) $(latext))
  1610. X
  1611. X# Don't use built-in rules.
  1612. X.SUFFIXES:
  1613. X.PHONY: clean clobber default dist install shar vars $(lt) $(spellt)
  1614. X
  1615. Xdefault: $(targets)
  1616. X
  1617. X# Display values of various variables.  Mostly for debugging.
  1618. Xvars:
  1619. X    @$(ECHO) 'SRCS:' $(SRCS)
  1620. Xifdef BS
  1621. X    @$(ECHO) 'BS:' $(BS)
  1622. X    @$(ECHO) 'bt:' $(bt)
  1623. X    @$(ECHO) 'bi:' $(bi)
  1624. Xendif
  1625. Xifdef CS
  1626. X    @$(ECHO) 'CS:' $(CS)
  1627. X    @$(ECHO) 'ct:' $(ct)
  1628. X    @$(ECHO) 'ci:' $(ci)
  1629. X    @$(ECHO) 'lt:' $(lt)
  1630. X    @$(ECHO) 'st:' $(st)
  1631. X    @$(ECHO) 'CC:' $(CC)
  1632. X    @$(ECHO) 'CFLAGS:' $(CFLAGS)
  1633. X    @$(ECHO) 'DEFS:' $(DEFS)
  1634. X    @$(ECHO) 'LIBPATH:' $(LIBPATH)
  1635. X    @$(ECHO) 'LIBES:' $(LIBES)
  1636. Xendif
  1637. Xifdef ELS
  1638. X    @$(ECHO) 'ELS:' $(ELS)
  1639. X    @$(ECHO) 'elt:' $(elt)
  1640. X    @$(ECHO) 'eli:' $(eli)
  1641. Xendif
  1642. Xifdef HS
  1643. X    @$(ECHO) 'HS:' $(HS)
  1644. Xendif
  1645. Xifdef FMTLATEX
  1646. X    @$(ECHO) 'LATEXS:' $(LATEXS)
  1647. X    @$(ECHO) 'BIBS:' $(BIBS)
  1648. X    @$(ECHO) 'latext:' $(latext)
  1649. X    @$(ECHO) 'spellt:' $(spellt)
  1650. Xendif
  1651. Xifdef M1S
  1652. X    @$(ECHO) 'M1S:' $(M1S)
  1653. X    @$(ECHO) 'cat1i:' $(cat1i)
  1654. X    @$(ECHO) 'm1i:' $(m1i)
  1655. Xendif
  1656. Xifdef M5S
  1657. X    @$(ECHO) 'M5S:' $(M5S)
  1658. X    @$(ECHO) 'cat5i:' $(cat5i)
  1659. X    @$(ECHO) 'm5i:' $(m5i)
  1660. Xendif
  1661. Xifdef M8S
  1662. X    @$(ECHO) 'M8S:' $(M8S)
  1663. X    @$(ECHO) 'cat8i:' $(cat8i)
  1664. X    @$(ECHO) 'm8i:' $(m8i)
  1665. Xendif
  1666. X    @$(ECHO) 'mi:' $(mi)
  1667. Xifdef FMTMAN
  1668. X    @$(ECHO) 'ft:' $(ft)
  1669. Xendif
  1670. X    @$(ECHO) 'allsrc:' $(allsrc)
  1671. X    @$(ECHO) 'dist:' $(dist)
  1672. X
  1673. Xclean:
  1674. X    -$(RM) depend $(st)
  1675. X
  1676. Xclobber: clean
  1677. X    -$(RM) $(src) $(targets) FREEZE FREEZE.*
  1678. X
  1679. Xifdef BS
  1680. X$(bt): %: %.b
  1681. X    $(RM) $@
  1682. X    $(ECHO) '  $(BDEFS)' > $@
  1683. X    $(CAT) $< >> $@
  1684. X    $(CHMOD) +x $@
  1685. Xendif
  1686. X
  1687. Xifdef CS
  1688. X$(ct): %: %.c
  1689. X    $(CC) -o $@ $(CFLAGS) $(DEFS) $(INCLUDES) $(LIBPATH) $*.c $(LIBES)
  1690. X
  1691. X$(lt): %-l: %.c $(LL)
  1692. X    $(LINT) $(LINTFLAGS) $(DEFS) $(INCLUDES) $< $(LL)
  1693. Xendif
  1694. X
  1695. Xifdef ELS
  1696. X$(elt): %.elc: %.el
  1697. X    $(ELCMP) $<
  1698. Xendif
  1699. X
  1700. Xifdef FMTMAN
  1701. X$(ft): %.f: %
  1702. X    $(RM) $@
  1703. X    $(FMTMAN) $< > $@
  1704. Xendif
  1705. X
  1706. Xifdef FMTLATEX
  1707. X$(latext): %.texf: %.tex $(BIBS)
  1708. X    $(FMTLATEX) $* $@
  1709. X
  1710. X$(spellt): %-s: %.tex
  1711. X    $(SPELL_LATEX) $<
  1712. Xendif
  1713. X
  1714. Xshar: $(allsrc)
  1715. X    $(SHAR) $(allsrc)
  1716. X
  1717. Xifdef CS
  1718. X$(st): %.s: %.c
  1719. X    $(CC) -S $(DEFS) $(INCLUDES) $<
  1720. Xendif
  1721. X
  1722. Xifdef WORK
  1723. X
  1724. Xdist: $(dist)
  1725. X
  1726. X$(dist): $(DD)/%: %
  1727. X    $(DISTO) $< $(DD)
  1728. X
  1729. X.DEFAULT:
  1730. X    $(UNCMPRS) $@
  1731. X
  1732. Xelse # WORK
  1733. X
  1734. Xinstall: $(bi) $(ci) $(cati) $(eli) $(mi)
  1735. X
  1736. Xifdef BS
  1737. X$(bi): $(BID)/%: %
  1738. X    $(INSTF) $< $(BID)
  1739. Xendif
  1740. X
  1741. Xifdef CS
  1742. X$(ci): $(CID)/%: %
  1743. X    $(INSTX) $< $(CID)
  1744. Xendif
  1745. X
  1746. Xifdef ELS
  1747. X$(eli): $(ELID)/%: %
  1748. X    $(INSTF) $< $(ELID)
  1749. Xendif
  1750. X
  1751. Xifdef M1S
  1752. X$(m1i): $(MID)/man1/%: %
  1753. X    $(INSTF) $< $(MID)/man1
  1754. X
  1755. Xifdef CATMAN
  1756. X$(cat1i): $(m1i)
  1757. X    $(CATMAN) -M $(MID) 1
  1758. Xendif
  1759. Xendif
  1760. X
  1761. Xifdef M5S
  1762. X$(m5i): $(MID)/man5/%: %
  1763. X    $(INSTF) $< $(MID)/man5
  1764. X
  1765. Xifdef CATMAN
  1766. X$(cat5i): $(m5i)
  1767. X    $(CATMAN) -M $(MID) 5
  1768. Xendif
  1769. Xendif
  1770. X
  1771. Xifdef M8S
  1772. X$(m8i): $(MID)/man8/%: %
  1773. X    $(INSTF) $< $(MID)/man8
  1774. X
  1775. Xifdef CATMAN
  1776. X$(cat8i): $(m8i)
  1777. X    $(CATMAN) -M $(MID) 8
  1778. Xendif
  1779. Xendif
  1780. X
  1781. X$(allsrc): %: $(DD)/%
  1782. X    $(DISTI) $@ $(DD)
  1783. X
  1784. X.DEFAULT:
  1785. X    $(DISTI) $@ $(DD)
  1786. X
  1787. Xendif # WORK
  1788. X
  1789. Xifdef CS
  1790. Xinclude depend
  1791. Xendif
  1792. XEOF
  1793. Xdone
  1794. END_OF_FILE
  1795. if test 6860 -ne `wc -c <'new-Make.b'`; then
  1796.     echo shar: \"'new-Make.b'\" unpacked with wrong size!
  1797. fi
  1798. # end of 'new-Make.b'
  1799. fi
  1800. if test -f 'strspn.c' -a "${1}" != "-c" ; then 
  1801.   echo shar: Will not clobber existing file \"'strspn.c'\"
  1802. else
  1803. echo shar: Extracting \"'strspn.c'\" \(656 characters\)
  1804. sed "s/^X//" >'strspn.c' <<'END_OF_FILE'
  1805. X/*
  1806. X * strspn - find length of initial segment of s consisting entirely
  1807. X * of characters from accept
  1808. X *
  1809. X * Public domain code by Henry Spencer.
  1810. X */
  1811. X
  1812. X#include <stdio.h>
  1813. X#include <howard/port.h>
  1814. X#include <howard/version.h>
  1815. X
  1816. XMODVER ("@(#)$Header: strspn.c,v 1.1 89/08/29 08:34:07 howard Exp $");
  1817. X
  1818. X#ifdef NOSTRSPN
  1819. Xint
  1820. Xstrspn(s, accept)
  1821. X char *s;
  1822. X char *accept;
  1823. X{
  1824. X    register  char *sscan;
  1825. X    register  char *ascan;
  1826. X    register int count;
  1827. X
  1828. X    count = 0;
  1829. X    for (sscan = s; *sscan != '\0'; sscan++) {
  1830. X        for (ascan = accept; *ascan != '\0'; ascan++)
  1831. X            if (*sscan == *ascan)
  1832. X                break;
  1833. X        if (*ascan == '\0')
  1834. X            return(count);
  1835. X        count++;
  1836. X    }
  1837. X    return(count);
  1838. X}
  1839. X#endif NOSTRSPN
  1840. END_OF_FILE
  1841. if test 656 -ne `wc -c <'strspn.c'`; then
  1842.     echo shar: \"'strspn.c'\" unpacked with wrong size!
  1843. fi
  1844. # end of 'strspn.c'
  1845. fi
  1846. echo shar: End of archive 3 \(of 9\).
  1847. cp /dev/null ark3isdone
  1848. MISSING=""
  1849. for I in 1 2 3 4 5 6 7 8 9 ; do
  1850.     if test ! -f ark${I}isdone ; then
  1851.     MISSING="${MISSING} ${I}"
  1852.     fi
  1853. done
  1854. if test "${MISSING}" = "" ; then
  1855.     echo You have unpacked all 9 archives.
  1856.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1857. else
  1858.     echo You still need to unpack the following archives:
  1859.     echo "        " ${MISSING}
  1860. fi
  1861. ##  End of shell archive.
  1862. exit 0
  1863.  
  1864.